//路由
const koaRouter = require("@koa/router");

//前缀
const userRouter = new koaRouter({ prefix: "/users" });

//controller路由逻辑
const { create, avatarInfo } = require("../controller/user_controller");

//用户验证 用户加密
const { verifyUser, handlePassWord } = require("../middleware/user.middleware");

// 用户注册
userRouter.post("/", verifyUser, handlePassWord, create);

// 用户头像
userRouter.get("/:userId/avatar", avatarInfo);

module.exports = userRouter;
